package com.example.design.patterns.geekbang.结构型.结构类似的模式.装饰器模式;

import java.io.IOException;

/**
 * 原始类: InputStream
 * 装饰器父类: FileInputStream
 * 装饰器类: BufferedInputStream ,  DataInputStream
 */
public abstract class InputStream {
    //...
    public int read(byte b[]) throws IOException {
        return read(b, 0, b.length);
    }

    public int read(byte b[], int off, int len) throws IOException {
        //...
        return 0;
    }

    public long skip(long n) throws IOException {
        //...
        return 0;
    }

    public int available() throws IOException {
        return 0;
    }

    public void close() throws IOException {
    }

    public synchronized void mark(int readlimit) {
    }

    public synchronized void reset() throws IOException {
        throw new IOException("mark/reset not supported");
    }

    public boolean markSupported() {
        return false;
    }

}



